﻿/*
 * Memory.h
 */
#ifndef __GDK_MEMORY_H__
#define __GDK_MEMORY_H__

#include <gdk/core/Types.h>
#include <gdk/core/new.h>

#include <string.h>
#include <stdlib.h>


namespace gdk
{

#if defined(__ANDROID__) || defined(__IOS__)  || defined(_M_X64)

__INLINE__ void* memCopy(void *to, const void *from, size_t size)
{
	return memcpy(to, from, size);
}
__INLINE__ void* memSet(void *dest, int c, size_t count)
{
	return memset(dest, c, count);
}
__INLINE__ void* memMove(void *to, const void *from, size_t size)
{
	return memmove(to, from, size);
}

#else

extern GDK_CORE_EXPORT void* (*__memcpy__)(void *to, const void *from, size_t size);
extern GDK_CORE_EXPORT void* (*__memset__)(void *dest, int c, size_t count);

__INLINE__ void* memCopy(void *to, const void *from, size_t size)
{
	return __memcpy__(to, from, size);
}
__INLINE__ void* memSet(void *dest, int c, size_t count)
{
	return __memset__(dest, c, count);
}
__INLINE__ void* memMove(void *to, const void *from, size_t size)
{
	return ::memmove(to, from, size);
}

#endif


}//namespace gdk







#endif //__GDK_MEMORY_H__
